import React from 'react';
import { inject, observer } from 'mobx-react';
import { Button } from "antd";

import { WeaLocaleProvider, WeaDialog} from 'ecCom';

import {Condition} from '../list/listCondition';
import {Text} from '../util/text';
const text = new Text();
const getLabel = WeaLocaleProvider.getLabel;

@observer
class SpecialDialog extends React.Component {

    render() {
        const { store,store:{title,status,setState,form,condition,saveInfoSpecial} } = this.props;
        const {visible} = status;
        return (
            <div >
                <WeaDialog ecId={`${this && this.props && this.props.ecId || ''}_WeaDialog@nz5gyc`}
                    icon="icon-coms-government"
                    iconBgcolor='#f14a2d'
                    title={title}
                    visible={visible}
                    style={{ width: 500, height: 150 }}
                    onCancel={() => setState({ visible: false }) }
                    buttons={[(<Button ecId={`${this && this.props && this.props.ecId || ''}_Button@874hlr@saveInfoSpecial`} type="primary"  onClick={() => saveInfoSpecial() }>{text.SURE}</Button>),
                        (<Button ecId={`${this && this.props && this.props.ecId || ''}_Button@om55h7@CANCEL`} type="ghost" onClick ={() => setState({ visible: false }) }>{text.CANCEL}</Button>)
                    ]}
                    >
                    <div class='wea_info_dialog'><Condition ecId={`${this && this.props && this.props.ecId || ''}_Condition@m146wy`} form={form} condition={condition}></Condition></div>
                </WeaDialog>
            </div>
        )
    }

}

export {SpecialDialog};